
//https://www.nowcoder.com/practice/c7df20a5a39e4357aecc1071e7fd523c?tpId=46&tqId=38886&rp=1&ru=/ta/classic-code&qru=/ta/classic-code&difficulty=1&judgeStatus=&tags=/question-ranking
class Transform {
public:
    int calcCost(int A, int B) {
        // write code here
        int t = A ^ B;
        int count = 0;
        while(t)
        {
            
            if(t & 1)
                count++;
            t >>=1;
        }
        return count;
    }
};

//https://www.nowcoder.com/practice/30c1674ad5694b3f8f0bc2de6f005490?tpId=46&tqId=38883&rp=1&ru=/ta/classic-code&qru=/ta/classic-code&difficulty=1&judgeStatus=&tags=/question-ranking
class BinInsert {
  public:
    int binInsert(int n, int m, int j, int i) {

        m <<= j;
        return m | n;
    }
};